Beta cell dysfunction is associated with type 1 and type 2 diabetes. Type 1 diabetes is usually diagnosed in children and young adults and results from autoimmune destruction of insulin-producing pancreatic cells. The defect in insulin production causes a dramatic rise of glucose levels in the blood and urine leading to polyuria (frequent urination), polydipsia (increased thirst), polyphagia (increased hunger), and weight loss. Type 1 diabetes is fatal unless treated with insulin injections, which is therapeutic, but not curative. The generation and production of insulin-secreting cells has long been a major goal in regenerative medicine to cure type 1 and certain types of type 2 diabetes. To date no method exists for the production of fully “functional” cells: that is, in vitro generated cells that can secrete insulin properly in response to physiologic levels of glucose. The production of such cells represents the best hope of curing diabetes. Accordingly, methods for obtaining fully functional beta cells and using such cells for the treatment of diabetes are urgently required.